<template>
    <van-grid square :column-num="5" icon-size="100">
        <van-grid-item v-for="item in miCategory" :key="value" :icon="item.img_url" :to="({ name:'moveShop'})"/>
    </van-grid>

</template>

<script setup>
import { onMounted, ref } from 'vue'
import axios from 'axios'
const miCategory = ref([])

//渲染挂载
onMounted(() => { 
    getcategory()
})

const getcategory = () => {
    axios.get('https://apis.netstart.cn/xmsc/home/page').then(res => { 
            console.log(res.data.data.data.sections[1].body.items);
        miCategory.value = res.data.data.data.sections[1].body.items;
            
    }).catch(error => { 
        console.log(error.message);
        
    }).finally(() => { 
        console.log("无论报错与否都会执行");
        
    })
}


</script>

<style lang="scss" scoped>

</style>